/*
 Navicat Premium Data Transfer

 Source Server         : kxwh001-pgsql
 Source Server Type    : PostgreSQL
 Source Server Version : 160004 (160004)
 Source Host           : 121.40.165.209:8085
 Source Catalog        : jd
 Source Schema         : authority

 Target Server Type    : PostgreSQL
 Target Server Version : 160004 (160004)
 File Encoding         : 65001

 Date: 06/12/2024 16:58:16
*/


-- ----------------------------
-- Sequence structure for data_auth_info_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "authority"."data_auth_info_id_seq";
CREATE SEQUENCE "authority"."data_auth_info_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER SEQUENCE "authority"."data_auth_info_id_seq" OWNER TO "hero";

-- ----------------------------
-- Sequence structure for data_role_info_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "authority"."data_role_info_id_seq";
CREATE SEQUENCE "authority"."data_role_info_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER SEQUENCE "authority"."data_role_info_id_seq" OWNER TO "hero";

-- ----------------------------
-- Sequence structure for rel_role_auth_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "authority"."rel_role_auth_id_seq";
CREATE SEQUENCE "authority"."rel_role_auth_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER SEQUENCE "authority"."rel_role_auth_id_seq" OWNER TO "hero";

-- ----------------------------
-- Sequence structure for rel_user_role_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "authority"."rel_user_role_id_seq";
CREATE SEQUENCE "authority"."rel_user_role_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER SEQUENCE "authority"."rel_user_role_id_seq" OWNER TO "hero";

-- ----------------------------
-- Table structure for data_auth_info
-- ----------------------------
DROP TABLE IF EXISTS "authority"."data_auth_info";
CREATE TABLE "authority"."data_auth_info" (
  "id" int8 NOT NULL DEFAULT nextval('"authority".data_auth_info_id_seq'::regclass),
  "guid" char(32) COLLATE "pg_catalog"."default" NOT NULL,
  "name" varchar(32) COLLATE "pg_catalog"."default" NOT NULL,
  "url" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "pid" varchar(32) COLLATE "pg_catalog"."default" NOT NULL,
  "type" int2 NOT NULL,
  "platform" varchar(32) COLLATE "pg_catalog"."default",
  "app_id" varchar(32) COLLATE "pg_catalog"."default",
  "created_at" int8,
  "updated_at" int8,
  "deleted_at" int8
)
;
ALTER TABLE "authority"."data_auth_info" OWNER TO "hero";
COMMENT ON COLUMN "authority"."data_auth_info"."id" IS '自增 ID';
COMMENT ON COLUMN "authority"."data_auth_info"."guid" IS '唯一 ID';
COMMENT ON COLUMN "authority"."data_auth_info"."name" IS '名称/描述';
COMMENT ON COLUMN "authority"."data_auth_info"."url" IS '菜单路由/动作key';
COMMENT ON COLUMN "authority"."data_auth_info"."pid" IS '父级id';
COMMENT ON COLUMN "authority"."data_auth_info"."type" IS '类型 1 菜单 2 动作 3 平台 4 模块';
COMMENT ON COLUMN "authority"."data_auth_info"."platform" IS '平台';
COMMENT ON COLUMN "authority"."data_auth_info"."app_id" IS '应用ID';
COMMENT ON COLUMN "authority"."data_auth_info"."created_at" IS '创建时间';
COMMENT ON COLUMN "authority"."data_auth_info"."updated_at" IS '更新时间';
COMMENT ON COLUMN "authority"."data_auth_info"."deleted_at" IS '删除时间';

-- ----------------------------
-- Records of data_auth_info
-- ----------------------------
BEGIN;
INSERT INTO "authority"."data_auth_info" ("id", "guid", "name", "url", "pid", "type", "platform", "app_id", "created_at", "updated_at", "deleted_at") VALUES (88, '5d6b7bd022274722969baf100047a53c', '运营管理后台', '/', '0', 3, 'admin', '0', 1698722252, 1698722252, NULL);
INSERT INTO "authority"."data_auth_info" ("id", "guid", "name", "url", "pid", "type", "platform", "app_id", "created_at", "updated_at", "deleted_at") VALUES (89, 'fab06a597c544fed81a1c69334c9bb75', '后台管理', '/admin', '5d6b7bd022274722969baf100047a53c', 4, 'admin', '0', 1698722290, 1698722290, NULL);
INSERT INTO "authority"."data_auth_info" ("id", "guid", "name", "url", "pid", "type", "platform", "app_id", "created_at", "updated_at", "deleted_at") VALUES (90, '7b82f8a2ee0244889db6a0784df3fade', '管理员管理', '/admin/list', 'fab06a597c544fed81a1c69334c9bb75', 1, 'admin', '0', 1698722318, 1698722318, NULL);
COMMIT;

-- ----------------------------
-- Table structure for data_role_info
-- ----------------------------
DROP TABLE IF EXISTS "authority"."data_role_info";
CREATE TABLE "authority"."data_role_info" (
  "id" int8 NOT NULL DEFAULT nextval('"authority".data_role_info_id_seq'::regclass),
  "guid" char(32) COLLATE "pg_catalog"."default" NOT NULL,
  "name" varchar(32) COLLATE "pg_catalog"."default" NOT NULL,
  "status" int2 NOT NULL,
  "platform" varchar(32) COLLATE "pg_catalog"."default",
  "app_id" varchar(32) COLLATE "pg_catalog"."default",
  "created_at" int8,
  "updated_at" int8,
  "deleted_at" int8
)
;
ALTER TABLE "authority"."data_role_info" OWNER TO "hero";
COMMENT ON COLUMN "authority"."data_role_info"."id" IS '自增 ID';
COMMENT ON COLUMN "authority"."data_role_info"."guid" IS '唯一 ID';
COMMENT ON COLUMN "authority"."data_role_info"."name" IS '角色名称';
COMMENT ON COLUMN "authority"."data_role_info"."status" IS '角色状态 1 正常 2 禁用';
COMMENT ON COLUMN "authority"."data_role_info"."platform" IS '平台';
COMMENT ON COLUMN "authority"."data_role_info"."app_id" IS '应用ID';
COMMENT ON COLUMN "authority"."data_role_info"."created_at" IS '创建时间';
COMMENT ON COLUMN "authority"."data_role_info"."updated_at" IS '更新时间';
COMMENT ON COLUMN "authority"."data_role_info"."deleted_at" IS '删除时间';

-- ----------------------------
-- Records of data_role_info
-- ----------------------------
BEGIN;
INSERT INTO "authority"."data_role_info" ("id", "guid", "name", "status", "platform", "app_id", "created_at", "updated_at", "deleted_at") VALUES (3, 'd7faa5d68c784e6184c382d523f19530', '管理员', 1, 'admin', '0', 1698722334, 1698722334, NULL);
COMMIT;

-- ----------------------------
-- Table structure for rel_role_auth
-- ----------------------------
DROP TABLE IF EXISTS "authority"."rel_role_auth";
CREATE TABLE "authority"."rel_role_auth" (
  "id" int8 NOT NULL DEFAULT nextval('"authority".rel_role_auth_id_seq'::regclass),
  "role_id" char(32) COLLATE "pg_catalog"."default" NOT NULL,
  "auth_id" char(32) COLLATE "pg_catalog"."default" NOT NULL,
  "platform" varchar(32) COLLATE "pg_catalog"."default",
  "app_id" varchar(32) COLLATE "pg_catalog"."default",
  "created_at" int8,
  "updated_at" int8,
  "deleted_at" int8
)
;
ALTER TABLE "authority"."rel_role_auth" OWNER TO "hero";
COMMENT ON COLUMN "authority"."rel_role_auth"."id" IS '自增 ID';
COMMENT ON COLUMN "authority"."rel_role_auth"."role_id" IS '角色唯一 ID';
COMMENT ON COLUMN "authority"."rel_role_auth"."auth_id" IS '权限唯一 ID';
COMMENT ON COLUMN "authority"."rel_role_auth"."platform" IS '平台';
COMMENT ON COLUMN "authority"."rel_role_auth"."app_id" IS '应用ID';
COMMENT ON COLUMN "authority"."rel_role_auth"."created_at" IS '创建时间';
COMMENT ON COLUMN "authority"."rel_role_auth"."updated_at" IS '更新时间';
COMMENT ON COLUMN "authority"."rel_role_auth"."deleted_at" IS '删除时间';

-- ----------------------------
-- Records of rel_role_auth
-- ----------------------------
BEGIN;
INSERT INTO "authority"."rel_role_auth" ("id", "role_id", "auth_id", "platform", "app_id", "created_at", "updated_at", "deleted_at") VALUES (158, 'd7faa5d68c784e6184c382d523f19530', '5d6b7bd022274722969baf100047a53c', 'admin', '0', 1698722337, 1698722337, NULL);
INSERT INTO "authority"."rel_role_auth" ("id", "role_id", "auth_id", "platform", "app_id", "created_at", "updated_at", "deleted_at") VALUES (159, 'd7faa5d68c784e6184c382d523f19530', 'fab06a597c544fed81a1c69334c9bb75', 'admin', '0', 1698722338, 1698722338, NULL);
INSERT INTO "authority"."rel_role_auth" ("id", "role_id", "auth_id", "platform", "app_id", "created_at", "updated_at", "deleted_at") VALUES (160, 'd7faa5d68c784e6184c382d523f19530', '7b82f8a2ee0244889db6a0784df3fade', 'admin', '0', 1698722339, 1698722339, NULL);
COMMIT;

-- ----------------------------
-- Table structure for rel_user_role
-- ----------------------------
DROP TABLE IF EXISTS "authority"."rel_user_role";
CREATE TABLE "authority"."rel_user_role" (
  "id" int8 NOT NULL DEFAULT nextval('"authority".rel_user_role_id_seq'::regclass),
  "role_id" char(32) COLLATE "pg_catalog"."default" NOT NULL,
  "user_id" char(32) COLLATE "pg_catalog"."default" NOT NULL,
  "platform" varchar(32) COLLATE "pg_catalog"."default",
  "app_id" varchar(32) COLLATE "pg_catalog"."default",
  "created_at" int8,
  "updated_at" int8,
  "deleted_at" int8
)
;
ALTER TABLE "authority"."rel_user_role" OWNER TO "hero";
COMMENT ON COLUMN "authority"."rel_user_role"."id" IS '自增 ID';
COMMENT ON COLUMN "authority"."rel_user_role"."role_id" IS '角色唯一 ID';
COMMENT ON COLUMN "authority"."rel_user_role"."user_id" IS '用户唯一 ID';
COMMENT ON COLUMN "authority"."rel_user_role"."platform" IS '平台';
COMMENT ON COLUMN "authority"."rel_user_role"."app_id" IS '应用ID';
COMMENT ON COLUMN "authority"."rel_user_role"."created_at" IS '创建时间';
COMMENT ON COLUMN "authority"."rel_user_role"."updated_at" IS '更新时间';
COMMENT ON COLUMN "authority"."rel_user_role"."deleted_at" IS '删除时间';

-- ----------------------------
-- Records of rel_user_role
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "authority"."data_auth_info_id_seq"
OWNED BY "authority"."data_auth_info"."id";
SELECT setval('"authority"."data_auth_info_id_seq"', 90, true);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "authority"."data_role_info_id_seq"
OWNED BY "authority"."data_role_info"."id";
SELECT setval('"authority"."data_role_info_id_seq"', 3, true);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "authority"."rel_role_auth_id_seq"
OWNED BY "authority"."rel_role_auth"."id";
SELECT setval('"authority"."rel_role_auth_id_seq"', 160, true);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "authority"."rel_user_role_id_seq"
OWNED BY "authority"."rel_user_role"."id";
SELECT setval('"authority"."rel_user_role_id_seq"', 1, false);

-- ----------------------------
-- Primary Key structure for table data_auth_info
-- ----------------------------
ALTER TABLE "authority"."data_auth_info" ADD CONSTRAINT "data_auth_info_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table data_role_info
-- ----------------------------
ALTER TABLE "authority"."data_role_info" ADD CONSTRAINT "data_role_info_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table rel_role_auth
-- ----------------------------
ALTER TABLE "authority"."rel_role_auth" ADD CONSTRAINT "rel_role_auth_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table rel_user_role
-- ----------------------------
ALTER TABLE "authority"."rel_user_role" ADD CONSTRAINT "rel_user_role_pkey" PRIMARY KEY ("id");
